package com.youbug.common.util;

import com.youbug.system.entity.User;

public class UserUtils {

    private static ThreadLocal<User> userThreadLocal = new ThreadLocal<>();

    public static String getCurrentUsername(){

        return userThreadLocal.get().getUsername();
    }

    public static User getCurrentUser(){

        return userThreadLocal.get();
    }

    public static void setCurrentUser(User user){
        userThreadLocal.set(user);
    }
}
